<HTML xmlns:z>
  
 
 <HEAD>
  <TITLE> New Document </TITLE>
  <META HTTP-EQUIV="pragma" CONTENT="no-cache">
  <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script type="text/javascript" 	src="../../js/jquery.pack.js"></script>
	<script type="text/javascript"  src="../../js/riaframework.js"></script>
	<script type="text/javascript"  src="../../js/Calendar.js"></script>
    <link rel="stylesheet" type="text/css" href="../../css/table_cssCn.css" />
	<link href="../../css/cssCn.css" rel="stylesheet" type="text/css">  
</HEAD>
 <script type="text/javascript">

function dede()
{
  document.getElementById("userId").value="";
  document.getElementById("userName").value="";
  document.getElementById("optObject").value="";
  document.getElementById("optType").value="";
  document.getElementById("userIp").value="";
  document.getElementById("time1").value="";
  document.getElementById("time2").value="";
} 

   function test()
   {
     var toolbar = getTableById('zteTable');
     if(toolbar.rows.length==1)
     {
       alert("没有符合条件的记录。");
     }  
   }
   
	function searchBefore(){
	   		var fElements=[];
	   		fElements.push(document.getElementById("userId"));
	   		fElements.push(document.getElementById("userName"));
	   		fElements.push(document.getElementById("optObject"));
	   		fElements.push(document.getElementById("optType"));
	   		fElements.push(document.getElementById("userIp"));
			
			for(i=0;i<fElements.length;i++){
				var eVal = fElements[i].value;
				if(eVal){
					eVal = eVal.replace(/(^\s*)|(\s*$)/g,"");
					fElements[i].value  =  eVal;
				}
			}
			
			setTime();
	}
	
	function setTime()
	{
	  var time = "";
	  var d = new Date();
	  var time1 = document.getElementById("time1").value;
	  var time2 = document.getElementById("time2").value;
	  
	  if(time1 == "")
	  {
	      time = d.getYear() +"-"; // Get year
		  time += (d.getMonth() + 1) + "-"; //Get month 
		  time += d.getDate(); //Get day 
		  document.getElementById("time1").value = time;
	  }
	  /*if(time1 != "" && time2 != "")
	  {		  
		  time = d.getYear() +"-"; // Get year
		  time += (d.getMonth() + 1) + "-"; //Get month 
		  time += d.getDate() + 1; //Get day 
		  document.getElementById("time2").value = time;
	  }
	  else if(time1 != "" && time2 == "")
	  {
	      var a = time1.split("-");
	      
	      time = a[0]+"-"; // Get year
		  time += (a[1] + 1) + "-"; //Get month 
		  time += a[2] + 1; //Get day 
		  document.getElementById("time2").value = time;
	  }
	  else if(time1 == "" && time2 == "")
	  {
	      var a = time2.split("-");
	      time = a[0]+"-"; // Get year
		  time += (a[1] + 1) + "-"; //Get month 
		  time += a[2] -1; //Get day 
		  document.getElementById("time1").value = time;
	  }*/
	  
	  
	}
   
    function onSearch()
   {
   		searchBefore();
		searchTableData('getAppLogList','$M.obj1','zteTable');
   }
   
   function exportToHtml()
   {
   
       setTime();
       var url = "exportLogReport.jsp?a=1";
     
       var str = document.getElementById("userId").value;
       if(str != "")
       {
         url = url + "&userId=" + str;
       }
       str = document.getElementById("userName").value;
       if(str != "")
       {
         url = url + "&userName=" + str;
       }
       //操作类型
       str = document.getElementById("optType").value;
       if(str != "")
       {
         url = url + "&optType=" + str;
       }
       //
       str = document.getElementById("userIp").value;
       if(str != "")
       {
         url = url + "&userIp=" + str;
       }
       //业务对象
       str = document.getElementById("optObject").value;
       if(str != "")
       {
         url = url + "&optObject=" + str;
       }
       
       str = document.getElementById("time1").value;
       
       if(str != "")
       {
         url = url + "&time1=" + str;
       }
       str = document.getElementById("time2").value;
       if(str != "")
       {
         url = url + "&time2=" + str;
       }
       //alert("before" + url);
       document.getElementById("htmlReport").href=encodeURI(url);
       //alert("after" + document.getElementById("htmlReport").href);
       document.getElementById("htmlReport").click();
   }
   
 function init()
 {
      //获取币种的快速编码
      callSid('getOptType');
      var d = new Date();
      time = d.getYear() +"-"; // Get year
	  time += (d.getMonth() + 1) + "-"; //Get month 
	  time += d.getDate(); //Get day 
	  document.getElementById("time1").value = time;

 }
 
 addOnloadEvent(init);
  </script>
<BODY>
	
<z:binds>
    <z:bind ctrl="userId"  ref="obj1.userId" />
	<z:bind ctrl="userName"  ref="obj1.userName" />	
	<z:bind ctrl="optObjecttype"  ref="obj1.optObjecttype"/>
	<z:bind ctrl="optObject"  ref="obj1.optObject" />
	<!--<z:bind ctrl="optType"  ref="obj1.optType" />-->
	<z:bind ctrl="userIp"  ref="obj1.userIp"/>
	<z:bind ctrl="time1"  ref="obj1.startTime"/>
	<z:bind ctrl="time2"  ref="obj1.endTime"/>
	<z:bind ctrl="optType" ref='obj1.optType'
				ctrlext="text:selectText;value:selectValue;defaultValue:selectDefault">
	</z:bind>
	<z:bind ctrl="zteTable"  ref="listArr" />	
</z:binds>
<z:service id='getAppLogList' method='post' url='easSaveOperationDS/getAppLogList.ssm'>
	<z:request onRequest=''  offRequest='' preRequest=''  postRequest='' />
	<z:response rtn='$M.listArr'  onResponse='' offResponse='' preResponse='' postResponse='test();'  onerror=''/>
</z:service>
<z:service id='export' method='post' url='easSaveOperationLog/export.ssm' isSyn='true'>
	<z:request onRequest=''  offRequest='' preRequest=''  postRequest='' />
	<z:response rtn='$M.result'  preResponse='' postResponse='toHtml($M.result)' />
</z:service>

<z:service id='getOptType' method='get' isSyn='true'
	url='easSaveOperationDS/findOptTypeForSelectCtr.ssm'>
	<z:request preRequest='' postRequest='' />
	<z:response rtn='$M.obj1.optType' preResponse='' postResponse='' />
</z:service>
<DIV id=overDiv style="POSITION: absolute; Z-INDEX: 1"></DIV>

     
		<table width="100%">
                <tbody>
                  <tr>
                    <td width="56%" nowrap>
                      <div class=div_subtitle>当前位置：系统管理<span class="arrow_subtitle">&gt;</span>日志管理<span class="arrow_subtitle">&gt;</span>业务日志查询</div></td>     
                   
                  </tr>
                </tbody>
            </table>
         <TABLE align=center width="100%" border="0"  cellPadding=0 cellSpacing=0 id=tb_content>
		  <TBODY>
		    <TR>
         <TD vAlign=top>
         <TABLE align=center class=tb_input border="0" cellPadding=0 cellSpacing=0 id=tb_content>
      <TBODY>
  
         <TR>
       <TD vAlign=top>
           <TABLE class=tb_searchbar cellSpacing=1 width="100%">
              <TBODY>
                <TR>
                  <TD colSpan=6><img src="../../images/search1.gif" width="13" height="13"> 查询条件</TD>
                </TR>
                <TR>
                  <TD width="10%" noWrap class="td_title">用户ID</TD>
                  <TD width="30%"><INPUT id="userId"  style="WIDTH: 100px">                  </TD>
                  <TD width="10%" noWrap class="td_title">姓名</TD>
                  <TD ><INPUT name=beginTime12 id="userName" style="WIDTH: 100px" size="20"></TD>
                </TR>
                <TR>
                  <TD noWrap class="td_title" >操作类型</TD>
                  <TD>
                      <select id="optType" name="optType" class="INPUT" style="WIDTH:120px"></select>
                   </TD>
                  <TD class="td_title" nowrap="nowrap">用户IP</TD>
                  <TD ><INPUT name="Input" id="userIp"  style="WIDTH: 100px"></TD>				  				 </TR>
				<TR>
                  <TD noWrap class="td_title">业务对象</TD>
                  <TD ><INPUT name=beginTime123 style="WIDTH: 100px" id="optObject" size="20"></TD>
                  <TD noWrap class="td_title" >操作时间</TD>
                  <TD>
                  <z:Calendar  id='test1' target='time1' value='' formate='yyyy-mm-dd' imgurl='../../images/calendar.gif'/> 
                  至 <z:Calendar  id='test2' target='time2' value='' formate='yyyy-mm-dd' imgurl='../../images/calendar.gif'/> 
                    </TD>
                </TR>
                <TR align="right">
                  <TD colspan="4" noWrap>				  
                      <INPUT class=button type=button value=查询 onClick="onSearch();" name=Submit52273>

                      <INPUT class=button type=button value=清空 onclick="dede()"/> 
                      <INPUT class=button type=button value=导出 onclick="exportToHtml()"/>
                      <a href="#" id="htmlReport" ></a>
                  </TD>
                </TR>
          </TBODY>
          </TABLE>
           </TD>
    </TR>
 
    <TR>
      <TD vAlign=top>
          
			<z:table id='zteTable' cellspacing="1" style='width:100%; FLOAT:right;display:none;' turnpage='true' 
			 pagesizelist='10,20,30,40,50'>
				
				<z:column id=col0 width="5%"  caption="序号" prop="$ROWNUM"></z:column>				
				<z:column id=col1  width="10%" caption="用户ID" prop="userId"></z:column>	
				<z:column id=col1  width="10%" caption="姓名" prop="userName">	</z:column>				
				<z:column id=col2   width="10%" caption="用户IP" prop="userIp"/>
			    <z:column id=col2   width="10%" caption="操作类型" prop="optType"/>
			    <z:column id=col2   width="10%" caption="业务对象" prop="optObject"/>
				<z:column id=col4  allowsort=true caption="操作时间" width="10%" prop="optTime" datatype="date(yyyy-mm-dd hh:mm:ss)"/>
				<z:column id=col2   width="15%" caption="操作内容" prop="optDetail"/> 
				
			</z:table>
		
	   
        </TD>
            </TR>	
         </TBODY>
         </TABLE>
</TD>
</TR>
</TBODY>
</TABLE>		

</BODY>


</HTML>
